#include <stdio.h>
int main()
{
    int month;
    int day;
    int year;
    int dijitian(int a,int b,int c);
scanf("%d,%d,%d",&day,&month,&year);
printf("是第几天:%d",dijitian(day,month,year));
return 0;
}





int dijitian(int a,int b,int c)
{
     int g=0;
     int i;
     int n[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
 if(c%400==0||c%4==0&&c%100!=0)
    {
       n[0]=a;
       n[2]=29;
    }
 else
    {
       n[0]=a;
       n[2]=28;
    }
 for(i=0;i<b;i++)
      {
          g=g+n[i];
      }
 return g;
}